package entities 
{
	/**
	 * ...
	 * @author morgan
	 */
	public class HitWithHeadBlock extends ReflectionSprite
	{
		
		public function HitWithHeadBlock(x:int, y:int, scene:GameScene, image:Class = null ) 
		{
			super(x, y, scene, image);
			immovable = true;
		}
		
		override public function update():void 
		{
			super.update();
			
			if (scene.player.y < y + height + 2 &&
				scene.player.x + scene.player.width > x &&
				scene.player.x < x + width &&
				scene.player.y > y &&
				scene.player.velocity.y < 0)
			{
				onHit();
				scene.player.velocity.y = 0;
			}			
		}
		
		public function onHit():void
		{
			
		}
	}

}